package com.gift.controller;

import com.gift.common.PaGing;
import com.gift.common.TimeHandler;
import com.gift.service.DataQueryService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Created by Administrator on 2017/12/21.
 */

@Controller
@RequestMapping("dataQuery")
public class DataQueryController {


    @Resource
    DataQueryService dataQueryService;

    //跳转到游戏账号流水首页
    @RequestMapping("/gameAccountQuery")
    public String toGameAccountQuery(){
        return "Dataquery/gameAccountQuery";
    }

    //跳转到银行流水首页
    @RequestMapping("/moneyDealQuery")
    public String toMoneyDealQuery(){
        return "Dataquery/moneyDealQuery";
    }


    //跳转到普通流水首页
    @RequestMapping("/normalDealQuery")
    public String toNormalDealQuery(){
        return "Dataquery/normalDealQuery";
    }


    //得到游戏账号流水（分页）
    @RequestMapping("/getAllGameAccount")
    @ResponseBody
    public PaGing getAllGameAccount(int page, int rows,@RequestParam Map<String,String> map){
        Map<String,Object> mapO ;
        mapO = TimeHandler.findParmHandler(map);

        return dataQueryService.getAllGameAccount(page,rows,mapO);
    }

    //得到银行流水（分页）
    @RequestMapping("/getAllMoneyDeal")
    @ResponseBody
    public PaGing getAllMoneyDeal(int page, int rows,@RequestParam Map<String,String> map){
        Map<String,Object> mapO ;
        mapO = TimeHandler.findParmHandler(map);

        return dataQueryService.getAllMoneyDeal(page,rows,mapO);
    }


    //得到普通流水（分页）
    @RequestMapping("/getAllNormalDeal")
    @ResponseBody
    public PaGing getAllNormalDeal(int page, int rows,@RequestParam Map<String,String> map){
        Map<String,Object> mapO ;
        mapO = TimeHandler.findParmHandler(map);

        return dataQueryService.getAllNormalDeal(page,rows,mapO);
    }



}
